package com.check.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import org.springframework.transaction.interceptor.TransactionAspectSupport;

import com.check.dao.SysSeqDao;
import com.check.pojo.SysSeq;
import com.check.service.SysSeqService;

@Service("sysSeqService")
public class SysSeqServiceImpl implements SysSeqService{

	@Autowired
	@Qualifier("sysSeqDao")
	private SysSeqDao sysSeqDao;
	
	public SysSeq findBySeqObj(String seqObj) {
		return sysSeqDao.doKeySelect(seqObj);
	}
	
	public boolean insertSysSeq(SysSeq sysSeq) {
		boolean flag=false;
		try {
			sysSeqDao.doInsert(sysSeq);
			flag=true;
		} catch (Exception e) {
			e.printStackTrace();
			TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
			flag=false;
		}
		return flag;
	}
	
	
	public boolean  updateSysSeq(SysSeq sysSeq) {
		boolean flag=false;
		try {
			sysSeqDao.doUpdate(sysSeq);
			flag=true;
		} catch (Exception e) {
			e.printStackTrace();
			TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
			flag=false;
		}
		return flag;
		
	}

}
